﻿/// <reference path="../../../extjs/ext-all-debug.js" />
Ext.define('yzmh.view.comic.List', {
    extend: 'Ext.grid.Panel',
    alias : 'widget.comiclist',
    closable: true,
    title: '',
    store: 'Comics',
    loadMask: true,
    columnLines: true,
    forceFit: true,
    viewConfig: {
        trackOver: false,
        stripeRows: true
    },
    tbar: [
            '查询: ', ' ', { xtype: 'tbfill' }, { action: 'htmlall', text: '生成全部漫画', icon: 'extjs/icons/html_go.png' }, "-", { action: 'html', text: '生成', icon: 'extjs/icons/html_go.png' }, { action: 'add', text: '新建', icon: 'extjs/icons/package_add.png' }, { action: 'delete', text: '删除', icon: 'extjs/icons/package_delete.png' }
    ],
    selType: 'rowmodel',
    selModel: Ext.create("Ext.selection.RowModel", {
        mode: 'MULTI'
    }),
    columns: [
        { header: '编号', dataIndex: 'id',align:'center', width:50 },
        {
            header: '名称', dataIndex: 'mhmc', width: 160, renderer: function (value, cell) {
                cell.tdAttr = 'data-qtip="' + value + '"';
                return value;
            }
        },
        {
            header: '别名', dataIndex: 'mhbm', flex: 0, renderer: function (value, cell) {
                cell.tdAttr = 'data-qtip="' + value + '"';
                return value;
            }
        },
        { header: '作者', dataIndex: 'zzmc', flex: 0 },
        { header: '地区', dataIndex: 'diqu', align:'center',width:50 },
        { header: '类别', dataIndex: 'classname', align: 'center', width: 80 },
        { header: '字母', dataIndex: 'zm', align: 'center', width: 50 },
        {
            header: '加入时间', dataIndex: 'adddate', align: 'center', renderer: Ext.util.Format.dateRenderer('Y-m-d')
        },
        { header: '章节', dataIndex: 'zjcount', align: 'center', width: 40 },
        { header: '更新时间', dataIndex: 'time', align: 'center', renderer: Ext.util.Format.dateRenderer('Y-m-d') },
        
        { header: '周点击', dataIndex: 'hits_w', align: 'center', width: 50 },
        { header: '月点击', dataIndex: 'hits_m', align: 'center', width: 50 },
        { header: '总点击', dataIndex: 'hits', align: 'center', width: 50 },
        { header: '题材', dataIndex: 'mhtc', flex: 0 },
        {
            action: 'ztchange',
            xtype: 'actioncolumn',
            dataIndex: 'zt',
            width: 40,
            header: '状态',
            align: 'center',
            renderer: function (value) {
                this.icon = value ? 'extjs/icons/完结.gif' : 'extjs/icons/连载.gif';
            }
        },
        {
            action: 'tjchange',
            xtype: 'actioncolumn',
            dataIndex: 'tj',
            width: 40,
            header: '推荐',
            align: 'center',
            renderer: function (value) {
                this.icon = value ? 'extjs/icons/accept.png' : 'extjs/icons/s.gif';
            }
        },
        {
            action: 'view',
            xtype: 'actioncolumn',
            width: 40,
            header: '预览',
            align: 'center',
            icon: 'extjs/icons/package_link.png'
        }, {
            action: 'edit',
            xtype: 'actioncolumn',
            width: 40,
            header: '编辑',
            align: 'center',
            icon: 'extjs/icons/user_edit.png'
        }
    ],
    bbar: {
        xtype:'pagingtoolbar',
        store:  'Comics',
        displayInfo: true,
        displayMsg: '显示数据 {0} - {1} of {2}',
        emptyMsg: "没有查询到数据",
        items: [{
            xtype: 'progressbar',
            text: '正在初始化...',
            width: 200,
            hidden: true
        }]
    }
});


